package indi.kider.server.apartment.api;

import indi.kider.common.constant.EmployeeRoleCons;
import indi.kider.common.model.apabus.RentOutline;
import indi.kider.common.model.apartment.Community;
import indi.kider.common.model.apartment.Houses;
import indi.kider.common.model.apartment.HousesMsg;
import indi.kider.common.model.employee.Employee;
import indi.kider.server.apartment.model.City;
import indi.kider.server.apartment.model.HouseRent;
import indi.kider.server.apartment.model.HousesCommunityQuery;
import indi.kider.server.apartment.service.ApartmentService;
import indi.kider.server.apartment.service.related.AuthcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pers.vankid.common.model.base.CommonResponse;
import pers.vankid.common.model.base.CoreException;
import pers.vankid.common.utils.page.PageRequest;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping(value = "apart")
public class ApartmentController {

    @Autowired
    private ApartmentService apartmentService;

    @Autowired
    AuthcService authcService;

    /**
     * @api {GET} /addDefHouses/{communityId}
     * @apiGroup apartment
     * @apiDescription 增加模板添加小区房源
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/addDefHouses
     * {"communityId":"公寓ID","id":"房源ID"}
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "200",
     * "msg": "查询成功！",
     * "data": [
     * {
     * "houseId": 7,
     * "houseNumb": "103",
     * "houseDecs": "3室·1厅",
     * "priceSet": "43333.0元/天",
     * "state": 1,
     * "stateName": "空置",
     * "setLease": null,
     * "community": "天天公寓",
     * "deposit": 2222.0,
     * "netCost": 1.0,
     * "propertyCosts": 4.0,
     * "powerCost": null,
     * "waterCost": null,
     * "gasCost": null,
     * "rent": null
     * }
     * <p>
     * ]
     * }
     */
    @PostMapping("/addDefHouses")
    public CommonResponse<HouseRent> addDefHouses(@RequestBody Houses houses) {
        Employee employee = authcService.getCurrentUser().getData();
        return CommonResponse.buildAddSuccessResponse("添加成功", apartmentService.addDefHouses(houses.getCommunityId(), houses.getId(), employee));
    }

    /**
     * @api {GET} apart/community/area
     * @apiGroup apartment
     * @apiDescription 根据用户获取城市和区域
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/community/area
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "200",
     * "msg": "查询成功！",
     * "data": [
     * {
     * "cityName": "杭州市",
     * "area": [
     * "拱墅区",
     * "西湖区"
     * ]
     * }
     * ]
     * }
     */
    @GetMapping("community/area")
    public CommonResponse<List<City>> getArea(HttpServletRequest request) {
        Long enterpriseId = 0L;
        Employee employee = authcService.getCurrentUser().getData();
        if (employee != null && !employee.getRoles().equals(EmployeeRoleCons.ADMIN)) {//超级管理员
            enterpriseId = employee.getEnterpriseId();
        }
        return CommonResponse.buildGetSuccessResponse(apartmentService.queryCityByUserCode(enterpriseId));
    }

    /**
     * @api {GET} /houses/{housesId}
     * @apiGroup apartment
     * @apiDescription 根据房屋id获取房屋的详细信息
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/houses/1
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "200",
     * "msg": "查询成功！",
     * "data": {
     * "id": 1,
     * "communityId": 1,
     * "houseNumb": "2",
     * "building": "1",
     * "unit": "A",
     * "priceSet": 2000,
     * "deposit": 2,
     * "area": 2,
     * "heading": null,
     * "cnt1": null,
     * "cnt2": null,
     * "depositRemark": null,
     * "e2url": null,
     * "e1url": null,
     * "h4url": null,
     * "h3url": null,
     * "h2url": null,
     * "h1url": null,
     * "outCode": 11,
     * "waterMeter": null,
     * "powerMeter": null,
     * "city": "杭州市",
     * "areas": "西湖区",
     * "community": "万科西庐",
     * "address": "蒋村",
     * "coordinate": "xxx",
     * "remark": "xxx",
     * "aroundDirs": "xxxxx"
     * }
     * }
     */
    @GetMapping("/houses/{housesId}")
    public CommonResponse<HousesMsg> getHousesMsgById(@PathVariable Long housesId) {
        return CommonResponse.buildGetSuccessResponse(apartmentService.queryHouseById(housesId));
    }

    /**
     * @api {GET} /community/{communityId}
     * @apiGroup apartment
     * @apiDescription 根据小区ID查询小区信息
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/community/1
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "200",
     * "msg": "查询成功！",
     * "data":   {
     * "id": 1,
     * "city": "杭州市",
     * "area": "西湖区",
     * "community": "万科西庐",
     * "address": "蒋村",
     * "coordinate": "xxx",
     * "remark": "xxx",
     * "aroundDirs": "xxxxx"
     * }
     * }
     **/
    @GetMapping("community/{communityId}")
    public CommonResponse<HousesMsg> queryCommunityById(@PathVariable Long communityId) {
        return CommonResponse.buildGetSuccessResponse(apartmentService.queryCommunityById(communityId));
    }

    /**
     * @api {POST}/community/list
     * @apiGroup apartment
     * @apiDescription 根据城市大区获取小区
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/community/list
     * {"city":"杭州市","area":"西湖区"}
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "200",
     * "msg": "查询成功！",
     * "data": [
     * {
     * "id": 1,
     * "city": "杭州市",
     * "area": "西湖区",
     * "community": "万科西庐",
     * "address": "蒋村",
     * "coordinate": "xxx",
     * "remark": "xxx",
     * "aroundDirs": "xxxxx"
     * }
     * ]
     * }
     */
    @PostMapping("/community/list")
    public CommonResponse<List<Community>> getCommunityByCity(@RequestBody Community community, HttpServletRequest request) {
        String city = community.getCity();
        String area = community.getArea();
        Employee employee = authcService.getCurrentUser().getData();
        if (employee != null && !employee.getRoles().equals(EmployeeRoleCons.ADMIN)) {//超级管理员
            community.setEnterpriseId(employee.getEnterpriseId());
        }
        return CommonResponse.buildGetSuccessResponse(apartmentService.queryCommunityByArea(city, area, community.getEnterpriseId()));
    }

    /**
     * @api {POST}/houses/list
     * @apiGroup apartment
     * @apiDescription 根据小区名称获取所有房源信息
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/houses/list
     * {"community":"万科西庐"}
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "200",
     * "msg": "查询成功！",
     * "data": [
     * {
     * "id": 1,
     * "communityId": 1,
     * "houseNumb": "2",
     * "building": "1",
     * "unit": "A",
     * "payType": "支付宝",
     * "priceSet": 2000,
     * "setLease": 1,
     * "leaseType": null,
     * "deposit": 2,
     * "area": 2,
     * "heading": null,
     * "cnt1": null,
     * "cnt2": null,
     * "depositRemark": null,
     * "e2url": null,
     * "e1url": null,
     * "h4url": null,
     * "h3url": null,
     * "h2url": null,
     * "h1url": null,
     * "outCode": 11,
     * "waterMeter": null,
     * "powerMeter": null
     * }
     * ]
     * }
     */
    @PostMapping("/houses/list")
    public CommonResponse<List<Houses>> getHousesByCommunity(@RequestBody Community community) {
        String communityName = community.getCommunity();
        return CommonResponse.buildGetSuccessResponse(apartmentService.queryByArea(communityName));
    }

    /**
     * @api {POST} /community
     * @apiGroup apartment
     * @apiDescription 新增小区
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/community
     * {"address":null,"area":null,"aroundDirs":null,"city":null,"community":null,"coordinate":null,"id":null,"remark":null}
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "201",
     * "msg": "保存成功！",
     * "data": 1
     * }
     */
    @PostMapping("/community")
    public CommonResponse addCommunity(@RequestBody Community community) {
        Employee employee = authcService.getCurrentUser().getData();
        if (employee != null && !employee.getRoles().equals(EmployeeRoleCons.ADMIN)) {//超级管理员
            community.setEnterpriseId(employee.getEnterpriseId());
        }
        int r = apartmentService.checkNameAndNumber(community);
        if (r > 0) {
            return CommonResponse.buildBadRequestResponse(r > 1 ? "编号已经存在" : "名称相同", -2);
        }
        return CommonResponse.buildAddSuccessResponse(apartmentService.addCommunity(community));
    }

    /**
     * @api {POST} /houses
     * @apiGroup apartment
     * @apiDescription 新增房屋
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/houses
     * {
     * "area": null,
     * "building": null,
     * "cnt1": null,
     * "cnt2": null,
     * "communityId": null,
     * "deposit": null,
     * "e1url": null,
     * "e2url": null,
     * "h1url": null,
     * "h2url": null,
     * "h3url": null,
     * "h4url": null,
     * "heading": null,
     * "houseNumb": null,
     * "id": null,
     * "leaseType": null,
     * "outCode": null,
     * "powerMeter": null,
     * "priceSet": null,
     * "unit": null,
     * "waterMeter": null
     * }
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "201",
     * "msg": "保存成功！",
     * "data": 1
     * }
     */
    @PostMapping("/houses")
    public CommonResponse<RentOutline> addHouse(@RequestBody Houses houses) {
        Employee employee = authcService.getCurrentUser().getData();
        return CommonResponse.buildAddSuccessResponse(apartmentService.addHouse(houses, employee));
    }

    /**
     * @api {PUT} /community
     * @apiGroup apartment
     * @apiDescription 修改小区以及相关信息
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/community
     * {"address":null,"area":null,"aroundDirs":null,"city":null,"community":null,"coordinate":null,"id":1,"remark":"yyyy"}
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "202",
     * "msg": "保存成功！",
     * "data": 1
     * }
     */
    @PutMapping("/community")
    public CommonResponse modifyCommunity(@RequestBody Community community) {
        return CommonResponse.buildUpdateSuccessResponse(apartmentService.updateCommunity(community));
    }

    /**
     * @api {PUT} /houses
     * @apiGroup apartment
     * @apiDescription 修改房屋信息
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/houses
     * {
     * "area": null,
     * "building": null,
     * "cnt1": null,
     * "cnt2": null,
     * "communityId": null,
     * "deposit": null,
     * "e1url": null,
     * "e2url": null,
     * "h1url": null,
     * "h2url": null,
     * "h3url": null,
     * "h4url": null,
     * "heading": null,
     * "houseNumb": null,
     * "id": 1,
     * "outCode": 12,
     * "powerMeter": null,
     * "priceSet": null,
     * "unit": null,
     * "waterMeter": null
     * }
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "202",
     * "msg": "保存成功！",
     * "data": 1
     * }
     */
    @PutMapping("/houses")
    public CommonResponse modifyHouses(@RequestBody Houses houses) {
        int result = apartmentService.updateHouse(houses);
        CommonResponse commonResponse = null;
        if (result == -2) {
            commonResponse = CommonResponse.buildBadRequestResponse("状态不对，不能更新", -2);
        } else {
            commonResponse = CommonResponse.buildUpdateSuccessResponse(1);
        }
        return commonResponse;
    }

    /**
     * @api {PUT} /houses/state
     * @apiGroup apartment
     * @apiDescription 修改房屋状态
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/houses/state
     * {"id": 1,"state":1}
     * @apiSuccessExample {json} 返回样例:
     * {status": "202","msg": "保存成功！","data": "" }
     */
    @PutMapping("/houses/state")
    public CommonResponse updateHouseState(@RequestBody Houses houses) {
        apartmentService.updateHouseState(houses);
        return CommonResponse.buildUpdateSuccessResponse("");
    }

    /**
     * @api {DELETE} /community/{id}
     * @apiGroup apartment
     * @apiDescription 根据小区ID删除
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/community/1
     * @apiSuccessExample {json} 返回样例:
     * {"status":"204","msg":"删除成功！","data":""}}
     */
    @DeleteMapping("/community/{id}")
    public CommonResponse delCommunityById(@PathVariable Long id) {
        try {
            apartmentService.delCommunityById(id);
            return CommonResponse.buildDelSuccessResponse("");
        } catch (CoreException e) {
            return CommonResponse.buildCoreExceptionResponse(e);
        }

    }

    /**
     * @api {DELETE} houses/{id}
     * @apiGroup apartment
     * @apiDescription 根据房屋ID进行删除
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/houses/1
     * @apiSuccessExample {json} 返回样例:
     * {"status":"204","msg":"删除成功！","data":""}}
     */
    @DeleteMapping("/houses/{id}")
    public CommonResponse delHousesById(@PathVariable Long id) {
        try {
            apartmentService.delHouseById(id);
            return CommonResponse.buildDelSuccessResponse("");
        } catch (CoreException e) {
            return CommonResponse.buildCoreExceptionResponse(e);
        }
    }

    /**
     * @api {POST} index/community
     * @apiGroup apartment
     * @apiDescription 小区（分页）
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/index/community
     * {"num":"0","size":"8","query":{"area":null,"city":null,"state":-1,"expression":"1","communityId":-1}}
     * @apiSuccessExample {json} 返回样例:
     * {"status":"200","msg":"查询成功！","data":{"rows":[{"communityId":1,"title":"天安门城楼·紫荆城","count":1,"roomList":[{"manSize":1,"womanSize":2,,"houseId":1,"houseNumb":"1","houseDecs":"","priceSet":"","state":1,"stateName":"已租","rent":{"id":1,"housesId":1,"communityId":1,"tenantId":1,"rentDate":"2018-05-15 00:00:00","state":1,"remark":"1","priceSet":"123","setLease":123,"leaseType":"12","deposit":"123","depositRemark":"123","initWaterRead":"132","initPowerRead":"123","payCycle":1,"wxopenId":null,"tenantName":"2123","tenantTel":"123","houseNumb":"123","building":"123","unit":"132","address":"123","community":"123","release":1}}],"open":false}],"total":1,"size":0}}
     */
    @PostMapping("/index/community")
    public CommonResponse getCommunityTitleList(@RequestBody PageRequest<HousesCommunityQuery> request) {
        Employee employee = authcService.getCurrentUser().getData();
        if (employee != null && !employee.getRoles().equals(EmployeeRoleCons.ADMIN)) {//超级管理员
            request.getQuery().setEnterpriseId(employee.getEnterpriseId());
        }
        return CommonResponse.buildGetSuccessResponse(apartmentService.getCommunityListNew(request));
    }

    /**
     * @api {POST} selectHouseMsgByEnterprise
     * @apiGroup apartment
     * @apiDescription 查询用户下所有房源(分页)
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/selectHouseMsgByEnterprise
     * {"num":1,"size":8,"query":"18013897594"}
     * @apiSuccessExample {json} 返回样例:
     * {"status":"200","msg":"查询成功！","data":{"rows":[{"id":82,"communityId":15,"houseNumb":"WN_0005","building":null,"unit":null,"area":2.0,"heading":"东","cnt1":1,"cnt2":1,"e2url":null,"e1url":"","h4url":null,"h3url":null,"h2url":null,"h1url":"","outCode":null,"waterMeter":null,"powerMeter":null,"priceSet":1100.0,"setLease":1,"deposit":1000.0,"state":2,"devs":"1,5","netCost":2.0,"propertyCosts":2.0,"powerCost":10.0,"waterCost":10.0,"shareCost":10.0,"gasCost":null,"city":"天津","areas":"河东区","community":"日日公寓","housesNumbs":0,"address":"日日鲁嘻嘻","coordinate":null,"remark":"","aroundDirs":"","tenantName":"wbb","tenantTel":"13333333333","cardId":"44","tenantId":69,"rent":{"id":105,"housesId":82,"communityId":15,"tenantId":69,"rentDate":"2018-05-28","state":1,"remark":"44","priceSet":1100.0,"setLease":1,"leaseType":null,"deposit":1000.0,"depositRemark":null,"initWaterReading":10.0,"initPowerReading":10.0,"payCycle":1,"wxopenId":null,"tenantName":"wbb","tenantTel":"13333333333","houseNumb":"WN_0005","building":null,"unit":null,"address":"日日鲁嘻嘻","community":"日日公寓","cardId":"44","netCost":2.0,"propertyCosts":2.0,"powerCost":10.0,"waterCost":10.0,"gasCost":null,"nationality":null,"professional":null,"friendsSize":1},"friends":[{"id":74,"name":"shixj1","cardId":"12212","phone":"1221","title":null,"nationality":"32","professional":"23","wxopenId":null,"state":1,"type":2,"friendsSize":null,"mainId":69}],"friendsSize":1}],"total":5,"size":5}}
     */
    @PostMapping("/selectHouseMsgByEnterprise")
    public CommonResponse selectHouseMsgByEnterprise(@RequestBody PageRequest<String> request) {
        return CommonResponse.buildGetSuccessResponse(apartmentService.selectHouseMsgByEnterprise(request));
    }
    /*  *//**
     * api {POST} index/house
     * apiGroup apartment
     * apiDescription 查询房源（分页）
     * apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/index/house
     * {"num":"0","size":"8","query":{"communityId":-1,"state":-1,"expression":""}}
     * apiSuccessExample {json} 返回样例:
     * {"status":"200","msg":"查询成功！","data":{"rows":[{"id":1,"communityId":1,"houseNumb":"1","building":"1","unit":null,"area":null,"heading":null,"cnt1":null,"cnt2":null,"e2url":null,"e1url":null,"h4url":null,"h3url":null,"h2url":null,"h1url":null,"outCode":null,"waterMeter":null,"powerMeter":null,"priceSet":null,"deposit":null,"state":1,"devs":null,"netCost":null,"propertyCosts":null,"powerCost":null,"waterCost":null,"gasCost":null,"rent":{"id":1,"housesId":1,"communityId":1,"tenantId":1,"rentDate":"2018-05-15 00:00:00","state":1,"remark":"1","priceSet":"123","setLease":123,"leaseType":"12","deposit":"123","depositRemark":"123","initWaterRead":"132","initPowerRead":"123","payCycle":1,"wxopenId":"1","tenantName":"2123","tenantTel":"123","houseNumb":"123","building":"123","unit":"132","address":"123","community":"123"},"decs":"null","stateName":"已租"}],"total":1,"size":0}}
     *//*
    @PostMapping("/index/house")
    public CommonResponse getHouseRentList(PageRequest<HouseRent> request) {
        return CommonResponse.buildGetSuccessResponse(apartmentService.getHouseRentList(request));
    }*/


    /**
     * @api {POST} verifyTheWaterDeviceIsUsed
     * @apiGroup apartment
     * @apiDescription 校验水表有效性
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/selectHouseMsgByEnterprise
     * {"num":1,"size":8,"query":"18013897594"}
     * @apiSuccessExample {json} 返回样例:
     * {"status":"200","msg":"查询成功！","data":{"rows":[{"id":82,"communityId":15,"houseNumb":"WN_0005","building":null,"unit":null,"area":2.0,"heading":"东","cnt1":1,"cnt2":1,"e2url":null,"e1url":"","h4url":null,"h3url":null,"h2url":null,"h1url":"","outCode":null,"waterMeter":null,"powerMeter":null,"priceSet":1100.0,"setLease":1,"deposit":1000.0,"state":2,"devs":"1,5","netCost":2.0,"propertyCosts":2.0,"powerCost":10.0,"waterCost":10.0,"shareCost":10.0,"gasCost":null,"city":"天津","areas":"河东区","community":"日日公寓","housesNumbs":0,"address":"日日鲁嘻嘻","coordinate":null,"remark":"","aroundDirs":"","tenantName":"wbb","tenantTel":"13333333333","cardId":"44","tenantId":69,"rent":{"id":105,"housesId":82,"communityId":15,"tenantId":69,"rentDate":"2018-05-28","state":1,"remark":"44","priceSet":1100.0,"setLease":1,"leaseType":null,"deposit":1000.0,"depositRemark":null,"initWaterReading":10.0,"initPowerReading":10.0,"payCycle":1,"wxopenId":null,"tenantName":"wbb","tenantTel":"13333333333","houseNumb":"WN_0005","building":null,"unit":null,"address":"日日鲁嘻嘻","community":"日日公寓","cardId":"44","netCost":2.0,"propertyCosts":2.0,"powerCost":10.0,"waterCost":10.0,"gasCost":null,"nationality":null,"professional":null,"friendsSize":1},"friends":[{"id":74,"name":"shixj1","cardId":"12212","phone":"1221","title":null,"nationality":"32","professional":"23","wxopenId":null,"state":1,"type":2,"friendsSize":null,"mainId":69}],"friendsSize":1}],"total":5,"size":5}}
     */
    @PostMapping("/verifyTheWaterDeviceIsUsed")
    public CommonResponse<List<String>> verifyTheWaterDeviceIsUsed(@RequestBody List<String> devs) {
        return CommonResponse.buildGetSuccessResponse(apartmentService.verifyTheDeviceIsUsed(devs, 1));
    }

    /**
     * @api {POST} verifyThePowerDeviceIsUsed
     * @apiGroup apartment
     * @apiDescription 校验电表有效性
     * @apiParamExample 请求样例：
     * http://localhost:9002/apartment/apart/selectHouseMsgByEnterprise
     * {"num":1,"size":8,"query":"18013897594"}
     * @apiSuccessExample {json} 返回样例:
     * {"status":"200","msg":"查询成功！","data":{"rows":[{"id":82,"communityId":15,"houseNumb":"WN_0005","building":null,"unit":null,"area":2.0,"heading":"东","cnt1":1,"cnt2":1,"e2url":null,"e1url":"","h4url":null,"h3url":null,"h2url":null,"h1url":"","outCode":null,"waterMeter":null,"powerMeter":null,"priceSet":1100.0,"setLease":1,"deposit":1000.0,"state":2,"devs":"1,5","netCost":2.0,"propertyCosts":2.0,"powerCost":10.0,"waterCost":10.0,"shareCost":10.0,"gasCost":null,"city":"天津","areas":"河东区","community":"日日公寓","housesNumbs":0,"address":"日日鲁嘻嘻","coordinate":null,"remark":"","aroundDirs":"","tenantName":"wbb","tenantTel":"13333333333","cardId":"44","tenantId":69,"rent":{"id":105,"housesId":82,"communityId":15,"tenantId":69,"rentDate":"2018-05-28","state":1,"remark":"44","priceSet":1100.0,"setLease":1,"leaseType":null,"deposit":1000.0,"depositRemark":null,"initWaterReading":10.0,"initPowerReading":10.0,"payCycle":1,"wxopenId":null,"tenantName":"wbb","tenantTel":"13333333333","houseNumb":"WN_0005","building":null,"unit":null,"address":"日日鲁嘻嘻","community":"日日公寓","cardId":"44","netCost":2.0,"propertyCosts":2.0,"powerCost":10.0,"waterCost":10.0,"gasCost":null,"nationality":null,"professional":null,"friendsSize":1},"friends":[{"id":74,"name":"shixj1","cardId":"12212","phone":"1221","title":null,"nationality":"32","professional":"23","wxopenId":null,"state":1,"type":2,"friendsSize":null,"mainId":69}],"friendsSize":1}],"total":5,"size":5}}
     */
    @PostMapping("/verifyThePowerDeviceIsUsed")
    public CommonResponse<List<String>> verifyThePowerDeviceIsUsed(@RequestBody List<String> devs) {
        return CommonResponse.buildGetSuccessResponse(apartmentService.verifyTheDeviceIsUsed(devs, 2));
    }

}
